import request from '@/utils/request'

// 查询货位列表
export function listWarehouse(query) {
  return request({
    url: '/supermarket/warehouse/list',
    method: 'get',
    params: query
  })
}

// 查询货位详细
export function getWarehouse(whId) {
  return request({
    url: '/supermarket/warehouse/' + whId,
    method: 'get'
  })
}

// 新增货位
export function addWarehouse(data) {
  return request({
    url: '/supermarket/warehouse',
    method: 'post',
    data: data
  })
}

// 修改货位
export function updateWarehouse(data) {
  return request({
    url: '/supermarket/warehouse',
    method: 'put',
    data: data
  })
}

// 删除货位
export function delWarehouse(whId) {
  return request({
    url: '/supermarket/warehouse/' + whId,
    method: 'delete'
  })
}
